<form class="layui-form seller-form" action="">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">操作时间：</label>

            <div class="layui-input-inline seller-inline-4">
                <input type="text" name="date" id="date" placeholder="开始时间 到 结束时间" autocomplete="off"
                       class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <button class="layui-btn layui-btn-sm" lay-submit lay-filter="*"><i class="iconfont icon-chaxun"></i>筛选
                </button>
            </div>
        </div>
    </div>
</form>

<div class="table-body">
    <table id="operationTable" lay-filter="operation"></table>
</div>

<script>
    var pid = 1;
    layui.use(['form', 'layedit', 'laydate', 'table'], function () {

        var layer = layui.layer,
                $ = layui.jquery,
                form = layui.form,
                laydate = layui.laydate;
        //时间插件
        laydate.render({
            elem: '#date',
            range: '到',
            format: 'yyyy-MM-dd'
        });

        var operationTables = layui.table.render({
            elem: '#operationTable',
            height: 'full-253',
            cellMinWidth: '80',
            page: true,
            limit: '20',
            url: "{:url('OperationLog/index')}?_ajax=1",
            id: 'operationTable',
            cols: [[
                {type: 'numbers'},
                {field: 'username', title: '操作员'},
                {field: 'ctime', title: '操作时间'},
                {field: 'desc', title: '操作描述'},
                {field: 'content', title: '操作内容'},
                {field: 'ip', title: '操作IP'}
            ]]
        });

        //筛选条件
        form.on('submit(*)', function(data){
            operationTables.reload({
                where: data.field,
                page: {curr: 1}
            });
            return false;
        });
    });
</script>
